package com.kewojiaoyu.splitscreendemo;


import android.annotation.SuppressLint;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import java.util.ArrayList;
import java.util.List;


/**
 * A simple {@link Fragment} subclass.
 */
public class MineFragment extends Fragment {

    int miType;
    ListView mlistView;

    public MineFragment() {
        // Required empty public constructor
    }

    @SuppressLint("ValidFragment")
    public MineFragment(int i) {
        miType = i;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View rootView = inflater.inflate(R.layout.fragment_mine, container, false);
        mlistView = rootView.findViewById(R.id.listView);
        List<String> data = new ArrayList<>();
        for (int i = 0; i < 40; i++) {
            if (miType == 0) {
                data.add("string=="+String.valueOf(i));
            }else {
                data.add("new string=="+String.valueOf(i));

            }
        }
        ArrayAdapter<String> adapter = new ArrayAdapter(getActivity(), android.R.layout.activity_list_item, android.R.id.text1, data);
        mlistView.setAdapter(adapter);

        return rootView;
    }

}
